package org.unv.mozhi.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.unv.mozhi.entity.MMsg;
import org.unv.mozhi.service.MozhiService;

@Controller
public class LoginController{
 
    @Autowired    
    private MozhiService mozhiService;
	
	@RequestMapping("/create")
	protected ModelAndView myMozhi() throws Exception {
		MMsg msg=new MMsg();
		System.out.println("FUCK YOU");
		mozhiService.addMessage(msg);
		ModelAndView model = new ModelAndView("home.xhtml");
		model.addObject("msg", "Login Succesful.");
		
		return model;
	}
}